using System;
using System.BusinessObjects.Data;
using System.Data;

namespace Blazing.BusinessObjects.Locations
{
    [Serializable]
	public class Address : DataObject<Address>
	{
		public virtual int ID
		{
			get
			{
				return GetValue<int>("ID");
			}
			set
			{
				BeginEdit();
				SetValue("ID", value);
			}
		}

        public virtual string Address1
		{
			get
			{
				return GetValue<string>("Address1");
			}
			set
			{
				BeginEdit();
				SetValue("Address1", value);
			}
		}

        public virtual string Address2
		{
			get
			{
				return GetValue<string>("Address2");
			}
			set
			{
				BeginEdit();
				SetValue("Address2", value);
			}
		}

        public virtual string Address3
		{
			get
			{
				return GetValue<string>("Address3");
			}
			set
			{
				BeginEdit();
				SetValue("Address3", value);
			}
		}

        public virtual string Suburb
		{
			get
			{
				return GetValue<string>("Suburb");
			}
			set
			{
				BeginEdit();
				SetValue("Suburb", value);
			}
		}

        public virtual string Postcode
		{
			get
			{
				return GetValue<string>("Postcode");
			}
			set
			{
				BeginEdit();
				SetValue("Postcode", value);
			}
		}


        [NonSerialized]
        State _state;
        public virtual State State
        {
            get
            {
                return _state;
            }
            set
            {
                BeginEdit();
                _state = value;
            }
        }

        [NonSerialized]
        Country _country;
        public virtual Country Country
        {
            get
            {
                return _country;
            }
            set
            {
                BeginEdit();
                _country = value;
            }
        }

        [NonSerialized]
        AddressType _addresstype;
        public virtual AddressType AddressType
        {
            get
            {

                return _addresstype;
            }
            set
            {
                BeginEdit();
                _addresstype = value;
            }
        }

        public Blazing.BusinessObjects.Cms.Geocode Geocode { get; set; }

        public virtual DateTime RowStamp
		{
			get
			{
				return GetValue<DateTime>("RowStamp");
			}
			set
			{
				SetValue("RowStamp", value);
			}
		}
		
	}
}
